// Message types
export interface Message {
  id: string;
  role: 'user' | 'assistant' | 'system';
  content: string;
  timestamp: number;
  attachments?: Attachment[];
}

export interface Attachment {
  id: string;
  name: string;
  type: 'image' | 'file';
  url: string;
  size: number;
}

// Agent types
export interface AgentConfig {
  model: string;
  systemPrompt?: string;
  maxTurns?: number;
  temperature?: number;
}

// Sidecar API types
export interface QueryRequest {
  prompt: string;
  options?: {
    model?: string;
    systemPrompt?: string;
    maxTurns?: number;
    includePartialMessages?: boolean;
    tools?: string[];
    subAgentId?: string; // ✅ 添加 sub-agent ID 支持
  };
}

export interface StreamEvent {
  type: 'message_start' | 'content_block_start' | 'content_block_delta' | 'content_block_stop' | 'message_delta' | 'message_stop';
  delta?: {
    type: 'text_delta';
    text: string;
  };
  index?: number;
  content_block?: any;
  message?: any;
  usage?: any;
}

export interface QueryResponse {
  type: 'stream_event' | 'assistant' | 'result' | 'error';
  event?: StreamEvent;
  content?: string;
  result?: string;
  error?: {
    code: string;
    message: string;
  };
}

// Skill types
export interface Skill {
  id: string;
  name: string;
  description: string;
  category: string;
  active: boolean;
  tools: string[];
}

// Store types
export interface ChatStore {
  messages: Message[];
  isLoading: boolean;
  addMessage: (message: Omit<Message, 'id' | 'timestamp'>) => void;
  clearMessages: () => void;
  setLoading: (loading: boolean) => void;
}

export interface SettingsStore {
  sidecarUrl: string;
  agentConfig: AgentConfig;
  setSidecarUrl: (url: string) => void;
  setAgentConfig: (config: Partial<AgentConfig>) => void;
}

